import request from '@/utils/request';

const handlerName = 'User';
export async function query(params) {
  return request(`/api/${handlerName}/GetPages`, {
    method: 'POST',
    data: params,
  });
}
export async function add(params) {
  return request(`/api/${handlerName}/Post`, {
    method: 'POST',
    data: { ...params },
  });
}
export async function update(params) {
  return request(`/api/${handlerName}/Put`, {
    method: 'PUT',
    data: { ...params },
  });
}
export async function remove(params) {
  return request(`/api/${handlerName}/Delete`, {
    method: 'DELETE',
    data: { ...params },
  });
}
export async function statusChange(params) {
  return request(`/api/${handlerName}/statusChange`, {
    method: 'PUT',
    data: { ...params },
  });
}
export async function get(params) {
  return request(`/api/${handlerName}/Get`, {
    method: 'Get',
    params: { ...params },
  });
}
export async function getTreeSelectData(params) {
  return request(`/api/Position/GetTreeSelectData`, {
    method: 'GET',
    params: { ...params },
  });
}
export async function getRoleTreeSelectData(params) {
  return request(`/api/Role/GetSelectData`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function getOrganizationTreeSelectData(params) {
  return request(`/api/Organization/GetTreeSelectData`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function getOrganizationCascaderSelectData(params) {
  return request(`/api/Organization/GetCascaderSelectData`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function getAccountByPhoneNumber(params) {
  return request(`/api/EnterpriseApplication/GetAccountByPhoneNumber`, {
    method: 'GET',
    params,
  });
}

export async function getStrategySelectData() {
  return request(`/api/Strategy/GetSelectData`, {
    method: 'GET',
  });
}
